package com.lemon.cloud.admin.service.impl;

import com.alicp.jetcache.anno.CacheInvalidate;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lemon.cloud.admin.service.SysDictItemService;
import com.lemon.cloud.comm.constants.CacheConstants;
import com.lemon.cloud.admin.entity.SysDictItem;
import com.lemon.cloud.admin.mapper.SysDictItemMapper;
import org.springframework.stereotype.Service;
@Service
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper,SysDictItem> implements SysDictItemService {

    @Override
    @CacheInvalidate(name = CacheConstants.DICT_DETAILS, key = "#sysDictItem.type")
    public Boolean delSysDictItem(SysDictItem sysDictItem) {
        if (sysDictItem==null){
            return true;
        }
        return this.removeById(sysDictItem.getId());
    }

}
